<%@ page import="aqv.Politician" %>



<div class="fieldcontain ${hasErrors(bean: politicianInstance, field: 'name', 'error')} required">
	<label for="name">
		<g:message code="politician.name.label" default="Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="name" required="" value="${politicianInstance?.name}"/>

</div>

<div class="fieldcontain ${hasErrors(bean: politicianInstance, field: 'surName', 'error')} required">
	<label for="surName">
		<g:message code="politician.surName.label" default="Sur Name" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="surName" required="" value="${politicianInstance?.surName}"/>

</div>

<div class="fieldcontain createPoliticianBirthDate ${hasErrors(bean: politicianInstance, field: 'birthDate', 'error')} required">
	<label for="birthDate">
		<g:message code="politician.birthDate.label" default="Birth Date" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="birthDate" precision="day"  value="${politicianInstance?.birthDate}"  />

</div>

<div class="fieldcontain ${hasErrors(bean: politicianInstance, field: 'description', 'error')} required">
	<label for="description">
		<g:message code="politician.description.label" default="Description" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="description" required="" value="${politicianInstance?.description}"/>

</div>

<div class="fieldcontain ${hasErrors(bean: politicianInstance, field: 'profilePic', 'error')} required">
	<label for="profilePic">
		<g:message code="politician.profilePic.label" default="Profile Pic" />
		<span class="required-indicator">*</span>
	</label>
	<input type="file" id="profilePic" name="profilePic" />

</div>






<div class="fieldcontain ${hasErrors(bean: politicianInstance, field: 'politicalParty', 'error')} required">
	<label for="politicalParty">
		<g:message code="politician.politicalParty.label" default="Political Party" />
		<span class="required-indicator">*</span>
		<span class="polPartyOnCreateUser">Tu partido politico no esta?Agregalo <a href="${createLink(controller : 'PoliticalParty', action:'create')}">aqui</a></span>
	</label>
	
	<g:if test="${params.action == 'edit'}">
		<g:select optionValue="name" id="politicalParty" name="politicalParty.id" from="${aqv.PoliticalParty.list()}" 
			optionKey="id" required="" value="${params.selectedPoliticalPartyID}" class="many-to-one"
			noSelection="${['null':'Seleccione un Partido politico...']}" disabled="disabled"/>
	</g:if>
	<g:else>
		<g:select optionValue="name" id="politicalParty" name="politicalParty.id" from="${aqv.PoliticalParty.list()}" 
			optionKey="id" required="" value="${params.selectedPoliticalPartyID}" class="many-to-one"
			noSelection="${['null':'Seleccione un Partido politico...']}" />
	</g:else>

</div>



<div class="fieldcontain ${hasErrors(bean: politicianInstance, field: 'politicalPartyRole', 'error')} required">
	<label for="politicalParty">
		<g:message code="politician.politicalPartyRole.label" default="Political Party Role" />
		<span class="required-indicator">*</span>
	</label>
	<g:select optionKey="id" optionValue="tittle" id="politicalPartyRole" name="politicalPartyRole" 
		from="${aqv.PoliticalPartyRole.list()}" required="" class="many-to-one" value="${politicianInstance?.politicalPartyRole?.id}" 
		noSelection="${['null':'Seleccione un Rol...']}" />

</div>

<%--<div class="fieldcontain ${hasErrors(bean: politicianInstance, field: 'projects', 'error')} ">--%>
<%--	<label for="projects">--%>
<%--		<g:message code="politician.projects.label" default="Projects" />--%>
<%--		--%>
<%--	</label>--%>
<%--	--%>
<%--<ul class="one-to-many">--%>
<%--<g:each in="${politicianInstance?.projects?}" var="p">--%>
<%--    <li><g:link controller="project" action="show" id="${p.id}">${p?.encodeAsHTML()}</g:link></li>--%>
<%--</g:each>--%>
<%--<li class="add">--%>
<%--<g:link controller="project" action="create" params="['politician.id': politicianInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'project.label', default: 'Project')])}</g:link>--%>
<%--</li>--%>
<%--</ul>--%>
<%----%>
<%----%>
<%--</div>--%>

